/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package imat;

import java.util.LinkedList;
import java.util.List;
import se.chalmers.ait.dat215.project.Product;

/**
 *
 * @author Andreas
 */
public class Category {
    private List<CategoryName> topCategory = new LinkedList<CategoryName>();
    private List<Product> products = new LinkedList<Product>();
    private CategoryName handler;
    private String label;

    public Category(CategoryName tc, List<Product> products, CategoryName handler, String label) {
        topCategory.add(tc);
        this.products = products;
        this.handler = handler;
        this.label = label;
    }

    public void setProducts(List<Product> products) {
        this.products = products;
    }
    public List<Product> getProducts() {
        return products;
    }

    public boolean equals(CategoryName handler) {
        return this.handler == handler;
    }

    public CategoryName getHandler() {
        return handler;
    }

    public String getLabel() {
        return label;
    }

    public boolean hasTopCategory(CategoryName c) {
        for (CategoryName cat : topCategory) {
            if (cat == c) return true;
        }
        return false;
    }

    public List<CategoryName> getTopCategories() {
        return topCategory;
    }
}
